package com.ruoyi.system.service.other;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Component
public class SendService {


    @Resource
    private StringRedisTemplate stringRedisTemplate;

    public void sendMessage(String message) {
        try {
            stringRedisTemplate.convertAndSend("notify", message);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
